package com.cs.controller;

import com.cs.domain.vo.NoticeVo;
import com.cs.service.NoticeService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Api(tags = "公告管理的接口")
@RequestMapping("/shop/notice")
public class NoticeController {
    @Autowired
    private NoticeService noticeService;

    /**
     * 查询前台的公告
     */
    @GetMapping("/topNoticeList")
    public ResponseEntity<List<NoticeVo>> loadTopNoticeList(){
        List<NoticeVo> noticeVos=noticeService.loadTopNoticeList();
        return ResponseEntity.ok(noticeVos);
    }
}
